<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script type="text/javascript">
	$(function() {
		var $grid = $('#grid_doc');
		var $title = '文档';
		var $baseUrl = 'file/doc';
		$grid.datagrid({
			title : $title + '列表',
			url : $baseUrl + '/page?sort=createTime,desc',
			dialog : {
				url : $baseUrl,
				name : $title,
				create : {
					width : 400,
					height : 400
				},
				update : {
					width : 400,
					height : 400
				}
			},
			pagination : true,
			pageSize : 50,
			pageList : [ 50, 100, 200 ],
			columns : [ [ {
				field : 'type',
				width : 120,
				title : '文档类型',
				formatter : function(value, row, index) {
					return row.type ? row.type.name : '';
				}
			}, {
				field : 'name',
				width : 120,
				title : '文件名称'
			}, {
				field : 'download',
				width : 40,
				title : '',
				formatter : function(value, row, index) {
					return '<a class="file_link" href="file/bidding/download?id=' + row.id + '">下载</a>';
				}
			}, /*  {
						field : 'auditTime',
						width : 180,
						title : '审核时间'
					}, {
						field : 'auditUser',
						width : 180,
						title : '审核者',
						formatter : function(value, row, index) {
							return row.auditUser ? row.auditUser.name : '';
						}
					},  */{
				field : 'project',
				width : 120,
				title : '所属项目',
				formatter : function(value, row, index) {
					return row.flow.project ? row.flow.project.name : '';
				}
			}, $.fields.description, {
				field : 'user',
				width : 80,
				title : '上传者',
				formatter : function(value, row, index) {
					return row.createUser ? row.createUser.name : '';
				}
			}, {
				field : 'createTime',
				width : 180,
				title : '上传时间'
			}, {
				field : 'lastModifyTime',
				width : 180,
				title : '更新时间'
			} ] ],
			toolbar : [ $.crudgrid.buttons.create, $.crudgrid.buttons.update, $.crudgrid.buttons.remove, '-', $.crudgrid.buttons.refresh ]
		}).treegrid('search.init');
	});
</script>
<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'center',split:true,border:false">
		<table id="grid_doc"></table>
	</div>
</div>